package com.demo;

import com.demo.Calculator;

public class MathTest {
	
	public static int count;
	
	static{
		
		System.out.println("This gets executed only once");
	}
	
	
	public static void staticTest(){
		System.out.println("test of static method and count is  " + count);
		count++;
	}

	
	public static void main(String[] args) {
		
	}
	
	
	/**
	 * @param args
	 */
	public static void main1(String[] args) {
		
	//	MathTest test = new MathTest();
/*		MathTest.staticTest();  //1   //0
		
		MathTest test1 = new MathTest();
		test1.staticTest(); //2     //1
		
		MathTest test2 = new MathTest();
		test2.staticTest(); //3     //2
		
		MathTest.staticTest(); //4   //3
*/		
		
		
		Calculator calc1 = new Calculator();
		System.out.println("default add result " +calc1.add());
		
		com.demo.Calculator calc2 = new com.demo.Calculator();
		System.out.println("calc2 add result " + calc2.add());
		calc1.changeAndAdd(calc2);	
		
		int first = 10;
		int second = 20;
		calc1.changeAndAdd(first, second);
		System.out.println("first" +first + "  second" + second);
		calc2.add();
		System.out.println("add result in math test " + calc2.add() );
		
		calc1.changeAndAdd(calc2);
		calc2.add();
		
		String name ="Demo class";
		
		
		
		
		

	}

}
